<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="./lodash.min.js"></script>
    <script>
        const obj = {
            name: '东东',
            age: 28,
            hobby: ['dance', 'sing', 'rap'],
            family: {
                name: '练练',
                age: 28,
                son: {
                    name: 'dd',
                    age: 10
                }
            },
            data: [{
                salary: 2000,
                price: 1000
            }]
        }
        // 使用lodash库，实现深拷贝
        const o = _.cloneDeep(obj)
        console.log(o)

        o.hobby[0] = 'game'
        console.log(obj)
    </script>
</body>

</html>